import 'package:flutter_test/flutter_test.dart';

void main() {
  void testParam({String name = "aa"}) {
    print(name);
    print(Car());
    print("天".toLowerCase());

    //padLeft(int width,String padding)：如果字符串长度小于width，在左边填充padding
    var date = new DateTime.now();
    String dateTime =
        "${date.year.toString()}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}_${date.hour.toString().padLeft(2, '0')}:${date.minute.toString().padLeft(2, '0')}:${date.second.toString().padLeft(2, '0')}";
    print(dateTime);
  }

  test('test selectable param', () {
    testParam(name: null);
  });
}

class Car {
  String name = "aa";

  Car({this.name = "bb"});

  @override
  String toString() {
    return 'Car{name: $name}';
  }
}
